<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ include file="../include/admincontent.jsp" %>
<div id="location">当前位置：招聘实施管理 > 招聘方案管理</div>
<div id="sy_search" class=" f0f0f0" style="display: inline-block">
    <form id="advanceQueryParam">
        <div style="background-color: #f0f0f0">
            <div class="clearfix more_query_area">
                <div class="query_area_body clearfix">
                    <div class="record_item">
                        <div class="record_item">
                            <div class="label">招聘方案:</div>
                            <div class="content">
                                <input type="text" id="demoReload" name="demoReload"/>
                            </div>
                        </div>
                    </div>
                    <div class="record_item">
                        <div class="record_item">
                            <div class="label">状态:</div>
                            <div class="content">
                                <div><select name="interest" id="sinterest">
                                    <option value="">请选择状态</option>
                                    <option value="-1">全部</option>
                                    <option value="0">编辑中</option>
                                    <option value="1">已发布</option>
                                    <option value="2">招聘结束</option>
                                    <option value="3">已关闭</option>
                                </select></div>
                            </div>
                        </div>
                    </div>
                    <div class="record_item">
                        <div class="toolbars">
                            <a id="searchbtn" >
                                <em class="ico16 search_16"></em>
                                <span class="menu_span" title="查询">查询</span>
                            </a>
                            <a id="searchreset">
                                <em class="ico16 refresh_16"></em>
                                <span class="menu_span" title="重置">重置</span>
                            </a>
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </form>
</div>
<div id="Content" style="margin-top: 10px">
    <div class="toolbars">
        <a id="project_add">
            <em id="add_em" class="ico16 add_new"></em>
            <span id="send_span" class="menu_span" title="添加">添加</span>
        </a>
        <a id="project_edit">
            <em  class="ico16 editor_16"></em>
            <span  class="menu_span" title="编辑">编辑</span>
        </a>
        <a id="project_del">
            <em  class="ico16 del_16"></em>
            <span  class="menu_span" title="删除">删除</span>
        </a>
        <a id="project_view">
            <em  class="ico16 preview_16"></em>
            <span  class="menu_span" title="查看">查看</span>
        </a>
        <a id="project_publish">
            <em  class="ico16 publish_16"></em>
            <span  class="menu_span" title="发布">发布</span>
        </a>
        <a id="project_close">
            <em  class="ico16 office20_16"></em>
            <span  class="menu_span" title="关闭招聘方案">关闭招聘方案</span>
        </a>
    </div>
</div>
<table class="layui-hide" id="tablelist" lay-filter="projectIndexTable"></table>
<script type="text/javascript">

    var recruitPlanTable;

   layui.use('table', function(){
        recruitPlanTable = layui.table;

        recruitPlanTable.render({
            id:'projectIndexTable'
            ,elem: '#tablelist'
            ,url:'/Project/getProListLayuiJson'
            ,title:'用户数据表'
            , height: 'full'
            ,cellMinWidth: 40 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
            ,cols: [[
                {type:'checkbox',fixed:'left' }
                ,{field:'id', title: '序号', fixed:'center',sort: true}
                ,{field:'pname',title: '招聘方案', fixed:'left'}
                ,{field:'recruittype',title: '招聘方式', fixed:'center', sort: true}
                ,{field:'pdisplay', title: '是否显示', fixed:'center'}
                ,{field:'startdate', title: '发布时间', fixed:'center',sort: true}
                ,{field:'enddate', title: '截止时间', fixed:'center', sort: true}
                ,{field:'adduname', title: '添加人', fixed:'center', sort: true}
                ,{field:'adddate', title: '添加时间', fixed:'center', sort: true}
                ,{field:'state',  title: '状态', fixed:'center', sort: true}
            ]]
            ,page: true
        });

       //var $ = layui.$, active = {
       $("#searchbtn").on('click', () => {
       //    reload: function(){
               var demoReload = $('#demoReload');
               var pstates = $("#sinterest").val();

               //执行重载
               recruitPlanTable.reload('projectIndexTable', {
                   url:'/Project/getProListLayuiJson'
                   ,method: 'get'
                   ,page:  {
                       curr: 1 //重新从第 1 页开始
                   }
                   ,where: {
                       key: {
                           pname: demoReload.val(),
                           pstate: pstates,
                       }
                   }
               }, 'data');
           });
     //  };

       $('.demoTable .layui-btn').on('click', function(){
           var type = $(this).data('type');
           active[type] ? active[type].call(this) : '';
       });
    });


   /* layui.use(['form'], function () {
        var form = layui.form;
        form.render();

        form.on('select(pstate)', function (data) {
            pstates = data.value;
        });
    });*/

    $("#searchreset").on('click', (e) => {
        document.getElementById("advanceQueryParam").reset();
        $("input[name='deptcode']").val("")
    });


    /* $(document).ready(function () {
          getList();
          $('#searchbtn').click(function () {
              getList();
          });

          $('#project_close').click(function () {

          });
      });

      function getList() {
          $("#page").myPagination({
              cssStyle: "pagination",
              singleCheck:true,
              saveChecked:true,
              ajax: {
                  on: true,
                  url: '/Project/getprojects',
                  param: $("#searchform").serialize(),
                  dataType: 'html',
                  callback: function (data) {
                      console.log(data);
                      $("#result").html(data);
                  }
              }
          });
      }*/
</script>
</body>
</html>